<template>
	<view class="container">
		<!-- 红色头部 -->
		<view class="header">
			<view class="welcome-text">
				<text class="greeting">你好，</text>
				<text class="title">欢迎来到薪火云鉴</text>
				<view class="subtitle-group">
					<text class="subtitle">Welcome to the Hall of Cultural Relics</text>
					<text class="subtitle">赏文物之美，品岁月悠长</text>
				</view>
			</view>
		</view>

		<!-- 米白色内容区域 -->
		<view class="content">
			<text class="num">182****4533</text>
			<button class="login-btn" @tap="handleLogin" @click="toindex()">
				本地号码一键登录
			</button>
			<button class="other">使用其他手机号登录</button>
			<div class="ic">
				<img src="@/static/qq.png" alt="" class="icon" />
				<img src="@/static/weixin.png" alt="" class="icon" />
				<img src="@/static/weibo.png" alt="" class="icon" />
			</div>
			<view class="agreement">
				<label class="checkbox-wrapper" @click="toggleAgreement">
					<view class="checkbox" :class="{ checked: isAgreed }"></view>
					<text class="agreement-text">
						我已阅读并同意
						<text class="link" @click.stop="navigateToProtocol('user')">《用户协议》</text>
						和
						<text class="link" @click.stop="navigateToProtocol('privacy')">《隐私政策》</text>
					</text>
				</label>
			</view>
		</view>
	</view>
</template>

<script setup>
	const handleLogin = () => {
		console.log('执行登录操作');
		// 这里可以添加实际的登录逻辑
	}
	function toindex(){
		uni.switchTab({
			url:'/pages/index/index'
		})
	}
</script>

<style lang="scss">
	.container {
		height: 100vh;
		display: flex;
		flex-direction: column;
		background: #9e0303;
	}

	.header {
		height: 500rpx;
		padding: 40rpx;
		position: relative;

		.welcome-text {
			color: #FFFFFF;
			margin-top: 80rpx;

			.greeting {
				font-size: 36rpx;
				font-weight: 300;
				display: block;
				margin-bottom: 30rpx;
			}

			.title {
				font-size: 60rpx;
				font-weight: bold;
				display: block;
				margin-bottom: 30rpx;
				line-height: 1.2;
			}

			.subtitle-group {
				display: flex;
				flex-direction: column;
				gap: 30rpx;

				.subtitle {
					font-size: 28rpx;
					font-weight: 300;
					opacity: 0.9;
				}
			}
		}
	}

	.content {
		flex: 1;
		background: #f7e7cd;
		border-radius: 40rpx 40rpx 0 0;
		padding: 80rpx 40rpx;
		display: flex;
		flex-direction: column;
		align-items: center;

		.other {
			margin: 30rpx;
			font-size: 20rpx;
			background: #f7e7cd;
		}

		.num {
			font-size: 48rpx;
			color: #333;
			margin-bottom: 60rpx;
			text-align: center;
			position: relative;

			// 添加装饰线（可选）
			&::after {
				content: '';
				display: block;
				width: 120rpx;
				height: 2rpx;
				background: rgba(172, 4, 3, 0.3);
				margin: 30rpx auto 0;
			}
		}

		.ic {
			margin-top: 200rpx;
			display: flex;
			flex-direction: row;
			gap: 80rpx;

			.icon {

				height: 80rpx;
				width: 80rpx;


				img {
					width: 100%;
					height: 100%;
				}
			}
		}
	}

	.login-btn {
		width: 100%;
		height: 100rpx;
		background: #AC0403;
		color: #F7E7CD;
		border-radius: 50rpx;
		font-size: 36rpx;
		font-weight: bold;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: all 0.3s ease;

		&::after {
			border: none;
		}

		&:active {
			transform: scale(0.96);
			opacity: 0.9;
		}
	}

	.agreement {
		margin-top: 100rpx;
		padding: 0 20rpx;
	}

	.checkbox-wrapper {
		display: flex;
		align-items: center;
	}

	.checkbox {
		width: 32rpx;
		height: 32rpx;
		border: 2rpx solid #ccc;
		border-radius: 50%;
		margin-right: 16rpx;
		transition: all 0.2s ease;
	}

	.checkbox.checked {
		border-color: #e54d42;
		background: #e54d42 url('') center/60% no-repeat;
	}

	.agreement-text {
		font-size: 24rpx;
		color: #333;
	}

	.link {
		color: #e54d42;
		text-decoration: underline;
	}
</style>